package UseUtil_Test;

import util.jdbc_utils;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;


//存在SQL注入漏洞
public class Util_Test01 {
    public static void main(String[] args) throws SQLException {

        //获得Connection数据库对象
        Connection connection = jdbc_utils.get_connection();
        //执行SQL对象
        Statement statement = connection.createStatement();
        //更新返回受影响的行数
        int num = statement.executeUpdate("INSERT into `users`(`id`,`name`,`password`,`email`,`birthday`)VALUES\n" +
                "\n" +
                "(5,'陈七','1233','2313@qq.com','1999-01-02')");
        if (num>0){

            System.out.println("插入成功");

        }


        //关闭close 释放连接
        jdbc_utils.release(connection,statement,null);


    }


}
